home *** CD-ROM | disk | FTP | other *** search
/ Invisible Universe / Invisible Universe (1995)(Voyager)[Mac-PC].iso / mac / MOVIES / SHARED.DIR / 01013_Script_go stuff shared < prev    next >
Text File  |  1995-11-21  |  12KB  |  475 lines

  1. on stopSoundIU
  2.   --  global gFadeOutP
  3.   --  
  4.   --  sound fadeOut 1, 1
  5.   --  sound stop 1
  6.   --  sound fadeIn 1, 1
  7.   --  
  8.   --  set gFadeOutP = 0
  9. end stopSoundIU
  10.  
  11. on soundFadeIU 
  12.   --  global gFadeOutP, gFadeEnd
  13.   --  
  14.   --  sound fadeOut 1, 120
  15.   --  set gFadeOutP = true
  16.   --  set gFadeEnd = the ticks + 1200
  17. end soundFadeIU
  18.  
  19. on soundFadeIdleIU
  20.   --  global gFadeOutP, gFadeEnd, gSoundIdle
  21.   --  
  22.   --  if voidP(gSoundIdle) then
  23.   --    set gSoundIdle = 0
  24.   --  else
  25.   --    if gSoundIdle = 120 then 
  26.   --      if gFadeEnd < the ticks then 
  27.   --        sound stop 1
  28.   --        set gFadeOutP = false
  29.   --        sound fadeIn 1, 1
  30.   --        set gSoundIdle = 0
  31.   --      end if
  32.   --    else
  33.   --      set gSoundIdle = gSoundIdle + 1
  34.   --    end if  
  35.   --  end if
  36. end soundFadeIdleIU
  37.  
  38.  
  39. on goGo theLabel, noRetrace
  40.   global gCurHist, gCurData, gNavPalette, gCom, gCurLabelProp
  41.   global gCurLabelList, gLabels, gNextMovie, gRetraceInProgress
  42.   global gTOCRetraceChan, gRetraceCount, gGlossPalette, gPoemLabel, gVolume
  43.   
  44.   cursor 4
  45.   
  46.   
  47.   --put ">>>goGo (1013)" && theLabel
  48.   
  49.   if char 1 of string(theLabel) = "P" then 
  50.     if theLabel = "PM" then set theLabel = "P1"
  51.     set gPoemLabel = string(theLabel)
  52.   end if
  53.   
  54.   set origFrameLabel = the frameLabel
  55.   
  56.   if the movie = "TOC.DIR" then
  57.     
  58.     --stopSoundIU
  59.     
  60.   end if
  61.   
  62.   if the movie = "TOUR.DIR" or the movie = "MOVIES.DIR" then puppetSprite 15, 0
  63.   
  64.   if the movie <> "FIND.DIR" and the movie <> "SHOWGLOS.DIR" then
  65.     if not noRetrace then
  66.       if the frameLabel = "" then
  67.         if gCurLabelProp = "" or voidP(gCurLabelProp) then
  68.           if the movie = "TOUR.DIR" or the movie = "MOVIES.DIR" then
  69.             set x = marker(0)
  70.             go to x
  71.             --put ">>>goGO retrace label =" & the frameLabel
  72.             addToRetrace(the frameLabel)  
  73.             --asdf
  74.           else
  75.             alert "Internal error 1013a (retrace error)"
  76.             exit  
  77.           end if
  78.           
  79.         else
  80.           addToRetrace(gCurLabelProp)
  81.         end if
  82.       else
  83.         addToRetrace(the frameLabel)
  84.       end if
  85.     end if
  86.   end if
  87.   
  88.   
  89.   
  90.   
  91.   if gCom then
  92.     -- change these to -1??? dmd tbd
  93.     
  94.     if gCurHist=0 then unGrayHist
  95.     if gCurData=0 then unGrayData
  96.     
  97.     go to string(gCurLabelProp)
  98.     
  99.     updateStage
  100.     
  101.   end if
  102.   
  103.   --put ">>> going to black frame from GoGo in 1013"
  104.   --beep
  105.   --puppetTransition 50, 20, 8, 0
  106.   --puppetTransition 50, 20, 8, 1
  107.   if the movie = "TOUR.DIR" or the movie = "MOVIES.DIR" then puppetSprite 15, 0
  108.   
  109.   go to label ("Black Frame")
  110.   
  111.   set the visibility of sprite gTOCRetraceChan = (gRetraceCount > 0)
  112.   
  113.   --beep
  114.   
  115.   if the movie = "TOC.DIR" then showCOMenus
  116.   
  117.   --
  118.   --
  119.   -- Get the new label from the list of all labels to get a this
  120.   -- object's label list.
  121.   --
  122.   set gCurLabelList = getAProp(gLabels, theLabel)
  123.   --put ">>> list for the prop: " & gCurLabelList
  124.   
  125.   if voidP(gCurLabelList) then
  126.     alert "Can't find label: " & quote & theLabel & quote & ". cast 1013"  
  127.     
  128.     set gCurLabelList = getAProp(gLabels, gCurLabelProp)  
  129.   else
  130.     set gCurLabelProp = theLabel
  131.   end if
  132.   
  133.   
  134.   set gNextMovie = getAt(gCurLabelList, 2)
  135.   
  136.   
  137.   set c1 = char 1 of gNextMovie
  138.   
  139.   if c1 = "O" then 
  140.     --put ">>> Going to a Celestial Object" && theLabel
  141.     set c1 = char 1 of string(theLabel)
  142.     
  143.     if not voidP(gGlossPalette) then tell gGlossPalette to lCloseGlossPalette
  144.     
  145.     if not gRetraceInProgress then
  146.       if ((the movie = "TOC.DIR") and ((char 1 of origFrameLabel) = "O")) or the movie = "STARMAP.DIR" then
  147.         sound playFile 1, "TRANS311.AIF"
  148.         set the volume of sound 1 = gVolume
  149.         
  150.         --      if the machineType <> 256 then
  151.         --        sound playFile 1, "::MEDIA:SOUNDS:TRANS3.AIF"
  152.         --      else
  153.         --        sound playFile 1, "..\MEDIA\SOUNDS\TRANS3.AIF"
  154.         --      end if
  155.       end if
  156.     end if
  157.     
  158.     updateStage
  159.     goObject(theLabel)
  160.   else
  161.     if gCom then 
  162.       hideButtons
  163.       tell gNavPalette to lCloseNavPalette(1)
  164.       
  165.       updateStage    
  166.     end if
  167.     
  168.     if c1 = "P" or c1 = "S" or c1 = "T" or c1 = "M" then
  169.       --put ">>> Going to a Poem or StarMap or TOC or Movies or Music" && theLabel
  170.       goGeneric(theLabel)
  171.     else
  172.       
  173.       beep
  174.       --put ">>> Don't know where I am going" && theLabel
  175.       alert "internal error: no where to go... cast 1013"
  176.       asdf
  177.     end if
  178.   end if
  179.   
  180.   cursor -1
  181.   
  182. end goGo
  183.  
  184. on goGeneric theLabel
  185.   
  186.   global gCurLabelProp, gNextMovie
  187.   
  188.   -- gLabels a list of all the labels
  189.   -- gCurLabelList the list for the current object
  190.   -- gCurLabelProp the current property
  191.   
  192.   --put ">>> goGeneric("&theLabel&")" 
  193.   
  194.   --put ">>> going to movie: " & gNextMovie & " label : "& string(theLabel)
  195.   
  196.   -- dmd make this work ??? TBD (should be faster) 
  197.   
  198.   puppetTransition 50, 10, 8, 0
  199.   puppetTransition 50, 10, 8, 0
  200.   
  201.   if the movie = gNextMovie then
  202.     go to frame string(gCurLabelProp)
  203.   else
  204.     go to frame string(gCurLabelProp) of movie gNextMovie
  205.   end if
  206.   
  207.   if the freeBytes < 500000 then
  208.     --put ">>> calling maxmem"
  209.     if the machineType <> 256 then maxmem() 
  210.   end if
  211.   
  212.   if the movie = "TOUR.DIR" and the frameLabel <> "" then
  213.     global gTourLabel
  214.     set gTourLabel = the frameLabel
  215.   end if
  216.   
  217.   if the movie = "MOVIES.DIR" and the frameLabel <> "" then
  218.     global gMovieLabel
  219.     set gMovieLabel = the frameLabel
  220.   end if
  221.   
  222.   if the movie = "TOC.DIR" and char 1 of theLabel = "P" then
  223.     global gLastPoem
  224.     
  225.     put theLabel into gLastPoem
  226.     --put char 2 of theLabel into word 1 of field "page"
  227.   end if
  228.   
  229. end goGeneric
  230.  
  231. on goObject theLabel
  232.   
  233.   global gLabels, gCurLabelList, gCurLabelProp, gCom, gNavPalette
  234.   global gUpdateViewsMenuP, gNavViews, gSuppPhoto, gUpdateNavPalette
  235.   global gNextMovie
  236.   
  237.   
  238.   -- gLabels a list of all the labels
  239.   -- gCurLabelList the list for the current object
  240.   -- gCurLabelProp the current property
  241.   
  242.   --put ">>> goObject("&theLabel&")" 
  243.   
  244.   --
  245.   --
  246.   -- This is the best place to set the flag... remove all others DMD TBD ???
  247.   --
  248.   set gSuppPhoto = (char 6 of string(theLabel)) = "S"
  249.   
  250.   set gUpdateViewsMenuP = 1
  251.   --  if not gSuppPhoto then
  252.   --    --
  253.   --    --
  254.   --    -- If this label is a member gNavViews, then don't change
  255.   --    -- the views menu.
  256.   --    --
  257.   --    set gUpdateViewsMenuP = 1
  258.   --    --    if listP(gNavViews) then
  259.   --    --      set gUpdateViewsMenuP = (getPos(gNavViews, theLabel) <> 0) 
  260.   --    --    end if
  261.   --  else
  262.   --    set gUpdateViewsMenuP = 0 
  263.   --  end if
  264.   
  265.   
  266.   --put "??? Update the Views menu? = " & gUpdateViewsMenuP
  267.   
  268.   
  269.   
  270.   
  271.   --put ">>> going to movie: " & gNextMovie & " label : "& string(theLabel)
  272.   
  273.   -- dmd make this work ??? TBD (should be faster) 
  274.   
  275.   --  set updateNavPalette = (mov = the movie) and (gCom) and (not gSuppPhoto)
  276.   set gUpdateNavPalette = (gCom) -- and (not gSuppPhoto)
  277.   --put ">>> updateNavPalette? " & gUpdateNavPalette
  278.   
  279.   --  if updateNavPalette then
  280.   --    updatePalPopUps
  281.   --  end if
  282.   
  283.   if the movie = gNextMovie then
  284.     go to frame string(gCurLabelProp)
  285.     setUpCelestialObjectStuff 
  286.   else
  287.     go to frame string(gCurLabelProp) of movie gNextMovie
  288.     -- Note: setUpCelestialObjectStuff is called from startMovie
  289.   end if
  290.   
  291.   --  if gSuppPhoto then
  292.   --    infoOpen
  293.   --    updateStage
  294.   --    setupHistandDataEtc
  295.   --  else
  296.   infoClose
  297.   showName
  298.   updateStage
  299.   setupHistandDataEtc
  300.   --  end if
  301.   
  302.   
  303. end goObject
  304.  
  305. on addToRetrace theLabel, theDesc
  306.   global gRetraceLabelList, gRetraceLabelLongForm, gRetraceCount
  307.   global gTSEnabled, gCom, gPoemLabel, gCurLabelProp
  308.   
  309.   --put ">>>shared addToRetrace: " & theLabel && theDesc
  310.   --
  311.   --
  312.   --
  313.   -- Check to see if a CO Text Hotspot is on the screen
  314.   --
  315.   if gCom then
  316.     if gTSEnabled or the frameLabel = "D" or the frameLabel = "H" then
  317.       --if gCom then 
  318.       set theLabel = objectLabel()
  319.       set gTSEnabled = 0
  320.       set the mouseDownScript to empty
  321.     end if
  322.   end if
  323.   
  324.   
  325.   --put ">>>addToRetrace: " & theLabel & theDesc
  326.   
  327.   if voidP(gRetraceLabelList) then 
  328.     set gRetraceLabelList = []
  329.     set gRetraceLabelLongForm = ""
  330.   end if
  331.   
  332.   if voidP(theLabel) or (theLabel = "")then
  333.     if the movie = "SHOWGLOS.DIR" or the movie = "FIND.DIR" then
  334.       --put ">>> exiting for SHOWGLOS or FIND"
  335.       exit
  336.     end if
  337.     
  338.     set newEntry = the frameLabel
  339.     if newEntry = "" then 
  340.       if the movie = "TOUR.DIR" or the movie = "MOVIES.DIR" then
  341.         go to the frame - 1
  342.         set newEntry = the frameLabel
  343.       else if the movie = "POETRY.DIR" then
  344.         set newEntry = gPoemLabel
  345.       else if gCurLabelProp <> "" then
  346.         set newEntry = gCurLabelProp
  347.       else
  348.         alert "Internal error 1013b (retrace error)"
  349.         asdf  
  350.       end if
  351.     end if
  352.     
  353.   else
  354.     set newEntry = string(theLabel)
  355.   end if
  356.   
  357.   --
  358.   --
  359.   -- Treat the CO menu as one screen, do not add sub entries to
  360.   -- the retrace list.
  361.   --
  362.   if the movie = "TOC.DIR" and (char 1 of newEntry = "O") then
  363.     if newEntry <> "OM" then exit  
  364.   end if
  365.   
  366.   
  367.   if voidP(theDesc) then
  368.     
  369.     set tempList = getaProp(gLabels, newEntry)
  370.     
  371.     if not voidP(tempList) then
  372.       set theDesc = getAt(tempList, 1)
  373.     else
  374.       put   ">>>Unknown location... error 43 cast 1013" & newENtry
  375.       Alert ">>>Unknown location... error 43 cast 1013" & newEntry
  376.       asdf  
  377.     end if
  378.     
  379.   end if
  380.   
  381.   --put ">>> Description of " & newEntry & " is " & theDesc
  382.   
  383.   
  384.   
  385.   --
  386.   --
  387.   -- If the last item on the list is the same, do not RE-ADD it.
  388.   --
  389.   
  390.   if gRetraceCount > 0 then 
  391.     --put ">>>" & quote & getAt(gRetraceLabelList, gRetraceCount) & quote && quote & newEntry & quote
  392.     --put ">>>" & quote & line gRetraceCount of gRetraceLabelLongForm & quote && quote & theDesc & quote
  393.     
  394.     if (getAt(gRetraceLabelList, gRetraceCount) = newEntry) and¼
  395.  ((line gRetraceCount of gRetraceLabelLongForm) = theDesc) then
  396.       exit 
  397.     end if
  398.   end if
  399.   
  400.   set theDesc = theDesc & RETURN
  401.   
  402.   if gRetraceCount = 15 then 
  403.     deleteAt(gRetraceLabelList, 1)
  404.     delete line 1 of gRetraceLabelLongForm
  405.   else
  406.     set gRetraceCount = gRetraceCount + 1
  407.   end if
  408.   
  409.   put theDesc after line gRetraceCount of gRetraceLabelLongForm
  410.   addAT gRetraceLabelList, gRetraceCount, newEntry
  411.   
  412.   
  413.   --put ">>> retrace desc: " & gRetraceLabelLongForm  
  414.   --put ">>> gRetraceLabelList = " & gRetraceLabelList
  415.   
  416.   return 0
  417.   
  418. end addToRetrace
  419.  
  420. on muGoxxx whar
  421.   global gMusicLabel
  422.   put whar into gMusicLabel
  423.   --go frame gMusicLabel of movie "Music"
  424.   addToRetrace
  425.   go movie "Music"
  426. end muGo
  427.  
  428. on toGoxxx whar
  429.   global gTourLabel
  430.   put whar into gTourLabel
  431.   addToRetrace
  432.   go movie "Tour"
  433. end toGo
  434.  
  435. on moGoxxx whar
  436.   global gMovieLabel
  437.   put whar into gMovieLabel
  438.   addToRetrace
  439.   go movie "Movies"
  440. end toGo
  441.  
  442. on poGoxxx PrevOrNext
  443.   global gLastPoem
  444.   put word 1 of field "page" into thisPage
  445.   if PrevOrNext = "Next" then
  446.     if thisPage = "9" then
  447.       put "1" into pageNum
  448.     else put string(integer(thisPage)+1) into pageNum
  449.   else
  450.     if thisPage = "1" then
  451.       put "9" into pageNum
  452.     else put string(integer(thisPage)-1) into pageNum
  453.   end if
  454.   put "P"&pageNum into gLastPoem
  455.   go label(gLastPoem)
  456.   put pageNum into word 1 of field "page"
  457. end poGo
  458.  
  459. on dump what
  460.   --  do "put ""e&string(value(what))"e&"&&""e&"=""e&what"e
  461. end
  462.  
  463. on mygoXXX whar
  464.   global gPreloadList, gPreloadIndex
  465.   -- use for this movie only
  466.   --
  467.   --
  468.   -- dmd explore this preload index stuff ??? 
  469.   --
  470.   --put ">>> mygo cast 1013"
  471.   
  472.   put getOne(gPreloadIndex, whar) into myIndex
  473.   justGo(getAt(gPreloadList, myIndex))
  474. end mygo
  475.